# -*- coding: utf-8 -*-
# @Time    : 2021/4/29 0029 22:04
# @Author  : 蒋才果
# @Email   : 1476235300@qq.com
# @File    : zuoye.py
# @Software: PyCharm
import string
import random
with open("big.txt","a+",encoding="utf-8") as f:
    for i in range(1000):
        f.write(("".join(random.choices(string.ascii_lowercase,k=random.randint(1,200)))+"\n"))

def func(txt):
    with open(txt,"r") as f:
        for i in f:
            if i:
                yield i
            else:
                return

w = func("big.txt")
maxlen = 0
for x in w:
    if len(x.strip()) >= maxlen:
        # print(j)
        maxlen,maxx = len(x)-1,x
print(maxlen,maxx)
